package com.apestech.api.condition.conlib;

import com.apestech.api.tables.TableExec;
import com.apestech.framework.json.JSONObject;
import com.apestech.framework.xml.condition.modul.Condition;
import com.apestech.framework.xml.table.modul.Tables;

public class ConDelete extends ConPub {

    public ConDelete(Condition condition) throws Exception {
        super(condition);
    }

    public void deleteTableByM(String id, String mid) throws Exception {
        String tabName=super.getCondition().getTableKey().getTabName(mid);
        deleteTable(id, tabName);
    }

    public void deleteTable(String id, String tabName) throws Exception {
        Tables tab=super.getCondition().getTablesById(tabName);
        TableExec table=new TableExec(super.getSession(), tab);
        table.deleteTable(id);
    }

    public void deleteTable(JSONObject input, String tabName) throws Exception {
        Tables tab=super.getCondition().getTablesById(tabName);
        TableExec table=new TableExec(super.getSession(), tab);
        table.deleteTable(input);
    }

}
